QuickTime Music Architecture

| Previous | Chapter Contents | Chapter Top | Next |

General Event

For events longer than two words, you use the general event with a subtype. Figure 11 illustrates the contents of a general event.

Figure 11 A note request general event

Table 8 Contents of a general event

General event type First nibble value = 1111
Part number Unique part identifier
Event length Head is number of words in event
Data words Depends on subtype
Subtype 8-bit unsigned subtype
Event length tail must be identical to head
Event tail First nibble of last word = 11XX

The part number bit field contains a unique identifier that is later used to match note, knob, and controller events to a specific part. For example, to play a note the application uses the part number to specify which instrument will play the note. The general event allows part numbers of up to 12 bits. The standard note and controller events allow part numbers of up to 5 bits; the extended note and extended controller events allow 12-bit part numbers.

The event length bit fields contained in the first and last words of the message are identical and are used as a message format check and to move back and forth through the message. The lengths include the head and tail; the smallest length is 2.

The data words field is a variable length field containing information unique to the subtype of the general event. The subtype bit field indicates the subtype of general event. There are nine subtypes:

Use these macro calls to stuff the general event's head and tail long words, but not the structures described above:

qtma_StuffGeneralEvent(w1, w2, instrument, subType, length)

Macros are used to extract field values from the event's head and tail long words.

qtma_XInstrument(m, l)
qtma_GeneralSubtype(m, l)
qtma_GeneralLength(m, l)

© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |